angular.module('seckillMod',[])
.controller('seckillCtrl',['$scope','$http','cart','total',function($scope,$http,cart,total){
	$http({
		url: 'http://h5.yztctech.net/api/axf/apimiaosha.php',
		method: 'get'
	}).success(function(res){
		$scope.seckillList = res.product;
	})
	$scope.addCar = function(key,i){
		if (!i.num) {
			i.num = 1;
		} else {
			i.num++;
		}
		cart.addFun(i,key);
		total.fun();
	}
}])

